<?php
/*
	商城设置，保存商城地址
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
cfc('core')->checklogin();
set_html('title','小店商城设置');
if($_RQ['op']=='main'){
	$item=$this->get('card',array('mid'=>$_SESSION['uid']),array('shop'));
	$return['item']=$item;
	exi($return);
}
if($_RQ['op']=='post'){
	$post=get_postdata();
	if(!$post['shop']){
		exi('请先输入商城地址！','error');
	}
	$this->update('card',array('shop'=>trim($post['shop'])),array('mid'=>$_SESSION['uid']));
	exi('设置成功！','','goback');
}